<script>


    let p1 = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve("p1准备好了")
        }, 3000)
    })

    let p2 = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve("p2准备好了")
        }, 2000)
    })

    let p3 = new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve("p3准备好了")
        }, 1000)
    })


    /* p2.then((res)=>{
        console.log("出发");
    }) */

    let  newp=Promise.all([p1, p2, p3])
    // 当p1  p2  p3  都成功时，才成功 newp
    // 一旦有一个失败  newp 就失败

    newp.then(res=>{
        console.log(res,"出发");
    })











</script>